home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _ProcessGetPriority.au3 < prev    next >
Text File  |  2007-09-08  |  677b  |  14 lines

  1. #include<process.au3>
  2.  
  3. Dim $i_Priority_Level, $i_Notepad_PID, $i_ArrayItem
  4. Dim $a_RunLevels[3] = [0, 2, 4] ;low, normal, high priorities
  5. ;Get Priority Level of this instance of AutoIt Scripting Engine
  6. $i_Priority_Level = _ProcessGetPriority (@AutoItPID)
  7. MsgBox(0, "AutoIt Script", "Should be 2: " & $i_Priority_Level)
  8. $i_Notepad_PID = Run(@ComSpec & ' /k notepad.exe', '', @SW_HIDE)
  9. For $i_ArrayItem = 0 To 2
  10.     ProcessSetPriority($i_Notepad_PID, $a_RunLevels[$i_ArrayItem])
  11.     $i_Priority_Level = _ProcessGetPriority ($i_Notepad_PID)
  12.     MsgBox(0, "Notepad Priority", "Should be " & $a_RunLevels[$i_ArrayItem] & ": " & $i_Priority_Level)
  13. Next
  14. ProcessClose('notepad.exe')